package com.rss.inbound.writers;

import java.util.List;

import org.springframework.batch.item.ItemWriter;

import com.rss.inbound.beans.RssEntry;
import com.rss.inbound.dao.RssEntryDAO;

public class RssDbWriter implements ItemWriter<List<RssEntry>>
{
    private RssEntryDAO rssEntryDao = null;

    @Override
    public void write(List<? extends List<RssEntry>> items) throws Exception
    {
	for (List<RssEntry> rssEntryList : items)
	{
	    rssEntryDao.persistList(rssEntryList);
	}
    }

    public void setRssEntryDao(RssEntryDAO rssEntryDao)
    {
	this.rssEntryDao = rssEntryDao;
    }
}
